
<div id="containercenter">
	<?php 
		require('navigation.php');
		require('navHistory.php'); 
		$table = new Table();
	?>
	<div id="containerleft">
		<h2>Tavoli da gioco: <u><?php echo $table->getTotTables(); ?></u></h2> 
		
		<?php 
		$result = $table->getTables();
		
		echo '<table id="tableList">';
			echo '<tr>';	
				while ($row = $result->FetchRow()) {
					echo '<td colspan="2">';
						echo '<h3>' . $row['name'] . '</h3>';
					echo '</td>';

				}
				unset($row);
				unset($result);
			echo '</tr>';
			echo '<tr>';
				$result = $table->getTables();
				while ($row = $result->FetchRow()) {
					echo '<td>';
						echo '<ul class="tableDetailsList">';
							echo '<li>Slot totali: <b>' . $row['tot_slot'] . '</b></li>';
							echo '<li>Slot liberi: <b>' . $row['free_slot'] . '</b></li>';
							echo '<li>Puntata minima: <b>' . $row['min_bet'] . ' ' . $table->checkMinBet($row['min_bet']) . '</b></li>';
						echo '</ul>';
					echo '</td>';
					echo '<td valign="bottom">';
						echo '<img src="' . $table->checkSlot($row['free_slot']) . '"></img>';
					echo '</td>';

				}
				unset($row);
				unset($result);
			echo '</tr>';
		echo '</table>';
		
		$result = $table->getTables();
		
		echo '<table id="tableList">';
			echo '<tr>';	
				while ($row = $result->FetchRow()) {
					echo '<td colspan="2">';
						echo '<h3>' . $row['name'] . '</h3>';
					echo '</td>';

				}
				unset($row);
				unset($result);
			echo '</tr>';
			echo '<tr>';
				$result = $table->getTables();
				while ($row = $result->FetchRow()) {
					echo '<td>';
						echo '<ul class="tableDetailsList">';
							echo '<li>Slot totali: <b>' . $row['tot_slot'] . '</b></li>';
							echo '<li>Slot liberi: <b>' . $row['free_slot'] . '</b></li>';
							echo '<li>Puntata minima: <b>' . $row['min_bet'] . ' ' . $table->checkMinBet($row['min_bet']) . '</b></li>';
						echo '</ul>';
					echo '</td>';
					echo '<td valign="bottom">';
						echo '<img src="' . $table->checkSlot($row['free_slot']) . '"></img>';
					echo '</td>';

				}
			echo '</tr>';
		echo '</table>';
			
		?>
		</span>
	</div>
		
	<div id="containerright">
		<h2>Statistiche generali</h2>
		<h3><img style="margin-bottom:-4px;" src="static/images/icon/nintendo.png"><i> Gioco</i></h3>
		<ul class="stats">
			<li>Vincita pi&ugrave; alta: <b>1462</b> crediti </li>
			<li>Blackjack totali: <b>132</b></li>
			<li>Partite in corso: <b>5</b></li>
		</ul>
		
		<h3><img style="margin-bottom:-3px;" src="static/images/icon/users.png"></img><i> Utenza</i></h3>
		
		<ul class="stats">
			<li>Utenti totali: <b>864</b></li>
			<li>Utenti online: <b>42</b> </li>
			<li>Utenti in gioco: <b>23</b> </li>
		</ul>
		
		<a href="index.php?p=credits">
			<div class="creditBox">
				<img class="minipic" alt="Acquista crediti" src="static/images/icon/paypal.jpg"/>
				<br/>
				Compra crediti
			</div>
		</a>

	</div>
</div>